POV-Ray : Newsgroups : povray.general : evenly spaced points on splines : Re: evenly spaced points on splines Server Time
31 Jul 2024 04:24:41 EDT (-0400)
  Re: evenly spaced points on splines  
From: Tim Attwood
Date: 17 Apr 2008 23:27:49
Message: <48081535$1@news.povray.org>
> I think you are confusing some notions. If you have something from R^n to
> R^p. First, on the image, R^p is just a bunch of of R put together, and 
> any
> sort derivation will act independently on each component. Therefore we can
> assume that p = 1.

Yeah I'm confused a bit. It's been a long time since calculus classes.

> If you have R^n -> R, you can speak of partial derivatives, or more
> generally of the derivative in a particular direction; or you can speak of
> differential forms, which puts everything together. The differential form 
> is
> the thingie that gives you the derivative in a particular direction 
> knowing
> the direction; the partial derivatives are the values of the differential
> form for the base vectors.

Since we don't know the equations that would go along with a POV
spline (it can be one of four spline types), and we don't know the
direction or velocity at any point on the spline, I think this means that
we can't do a direct math solution to this as a POV macro that takes a
POV spline as a parameter. I could be wrong though.

> <troll>
> Curl, divergence and similar operators are just properties of the
> differential form defined by physicists and engineers who do not 
> understand
> differential forms.
> </troll>

Mathematicians can tell you how things should work,
engineers can tell you how things really do work.

> But all this is somewhat advanced calculus. In France at least, it is only
> taught to science students in college or similar level.

Yeah, topology feels like graduate level math.

> But in the n = 1 case, everything is much simpler: there is only one 
> partial
> derivative, which is thus no longer partial. The derivative of a function 
> is
> just the slope of the tangent to the curve. And if the function represents
> the position of a point on an axis, then the derivative is the speed of 
> the
> point.
>
> (For the record, still in France, this is taught to high school in
> penultimate year to most students.)

That's the same way in the USA, except that sometimes it's first
year college if they didn't get it in high school.

> If you have several dimensions for the image, as I said, each dimension
> operates independently. That gives you the coordinates of a vector, called
> the derivative vector.
>
> If you see your function as a parametric arc, then the derivative vector 
> is
> a direction vector of the tangent to the arc (except at singular points, 
> of
> course).
>
> If your function is the trajectory of an object, then the derivative 
> vector
> is its speed.

You would need to sample the POV spline at multiple points to estimate
the slope or speed, even if you are treating it parametrically.

> Now, for any sane definition, the length of a smooth curve given as a
> parametric arc is the integral of the length of the derivative vector.

POV splines aren't always smooth though.

> To approximate the length of a curve, you can approximate it by a 
> polygonal
> line, and compute the length of that line. That was the proposed solution.

Right, digging out my old calculus book, this is the first solution for 
length
of a curve.

> But if you happen to know the exact derivative vector at any point, then I
> suspect that using it instead will be more accurate.
>> Remember that we don't know the type of spline here either.

Yeah it can be a definite integral, if you know the derivative
which we don't really. (That's the next page in the book.)

> The term spline commonly refers to piecewise polynomial curves, and
> especially with degree 3 (which allow to 4 control points: the start, the
> end, and the derivative vectors for both).

Sure, but I meant a POV spline.

> The derivative of a polynomial is pretty easy to compute.

Sure, but you can't do that for a POV spline easily.

You could do circle fitting with three points, but on sharp corners
that would be worse instead of better. You might do OK with some
sort of hybrid that can reject sharp corners and go back to linear
fitting, not sure if that would be better by much though, the current
macro seems accurate enough to me.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.